<!DOCTYPE HTML>
<?php 
	session_start(); 
	
	if(isset($_SESSION['id'], $_SESSION['vorname'], $_SESSION['name'])){
		$id = $_SESSION['id'];
		$vorname = $_SESSION['vorname'];
		$name = $_SESSION['name'];
	}

    function RankName() {
        $sql = "USE web_db";
        $link = mysqli_connect('localhost', 'root', '') or die("Failed to connect to MySQL: " . 
                mysql_error());
        $result = mysqli_query($link,$sql);

        $sql = "SELECT workstation FROM rank WHERE rank_nr=".$_SESSION['workstation'];
        $result = mysqli_query($link,$sql);

        $row = mysqli_fetch_row($result);
        echo $row[0];
    }
?>
<html>

<head>
<title>Privacy</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<link href='./images/favicon.ico' rel='shortcut icon' type='image/png'>
<link rel="stylesheet" type="text/css" href="./css/index.css">
</head>


<body id="fondo">
<div id="cuerpo">
<fieldset style="width: 1000px; color: #FFF;";>
    <?php
        include 'header.php';
    ?>
	<div id="subcuerpo">
    	<table>
        <tr>
        	<td id="principal"><h2>Privacy</h2></td>
			<?php if(isset($_SESSION['id'], $_SESSION['vorname'], $_SESSION['name'])) : ?>
			<td id="logged"><h2>Welcome back, <?php RankName(); echo " ".$vorname?></h2></n>
            				<table id="logout">
                				<tr><form method="POST" action="log_out.php">
								</tr>
                                <tr><td></td><td><input type="submit" name="submit" value="Logout"></td>
                				</form></tr>
                				</table></td>
			<?php else : ?>
            <td id="submenu"><h2>Log in</h2></n>
            				<table id="login">
                				<tr><td><form method="POST" action="login.php">ID: </td><td><input type="text" name="id"></td>
                				</tr>
                				<tr><td>Password: </td><td><input type="password" name="pwd"></td>
                                <tr><td></td><td><input type="submit" name="submit" value="Log in"></td>
                				</form></tr>
                				</table></td>
			
			<?php endif; ?>
        </tr>
        <tr>
        	<td>Confidentiality and protection of your data is of paramount importance to Ewigkeit Company (hereinafter "Ewigkeit"). The protection of personal data collected, processed, and used in connection with your visit to our website is very important to us. Collection and use of your personal data is protected exclusively in accordance with the applicable data protection regulations. This privacy policy aims to inform you about the collection and use of your personal data whilst using our website (localhost, by now). This agreement shall be governed by and construed in accordance with the German Federal Data Protection Act (BDSG) and the parties hereby submit to the exclusive jurisdiction of the German courts in respect of any dispute or matter arising out of or connected with this agreement. Any translation of the English language or German law version of this agreement (the "Original Agreement") is provided for convenience only and you agree that in the event of a conflict between the translated version and the Original Agreement, the provisions of the Original Agreement shall prevail.</td>
        </tr>
        </table>
    </div>
<?php
    include 'footer.php';
?>
</fieldset>
</div>
</body>